<template>
		<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
	<view class="warp">
		<view class="banner" v-if="activityinfo.bannerList.length!=0">
			<view class="uni-margin-wrap">
						<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
							:duration="duration">
							<swiper-item v-for="(item,index) in activityinfo.bannerList">
								<view class="swiper-item uni-bg-red" style="background-color: red;">
									<image style="width: 750rpx;height: 300rpx;" :src="item.bannerContent" mode="widthFix"></image>
								</view>
							</swiper-item>
							
					</swiper>
			</view>
		</view>
		<!-- 模块一 -->
		<view class="modey_f" >
			<view class="title" v-if="modeyf.contentSmallTilte">
			 {{modeyf.contentSmallTilte}}
			</view>
			<view v-if="modeyf.contentList" class="f_text" style="text-indent: 2em;color: #282828;">
				{{modeyf.contentList[0].contentContent}}
			</view>
		</view>
		<!-- 模块二 -->
		<view class="modey_s" >
			<view class="title" v-if="modeys.contentSmallTilte">
				{{modeys.contentSmallTilte}}
			</view>
			<view v-if="modeys.contentList.length!=0" class="image_list" style="overflow: auto;  display: -webkit-flex;  display: flex;">
				<view class="image" v-for="(item,index) in modeys.contentList" :key="index">
					<image @click="showImage(modeys.contentList)" style="width: 400rpx;height: 250rpx;" :src="item.contentContent" mode="heightFix"></image>
				      <view class="" style="text-align: center;">
				      	{{item.contentExtra}}
				      </view>
				</view>
			</view>
		</view>
		<!--模块三 -->
		 <view class="modey_t"  >
		 	<view class="title" style="padding: 0 30rpx;" v-if="modeyt.contentSmallTilte">
				{{modeyt.contentSmallTilte}}
		 	</view>
		 	<view class="image_lang" v-if="modeyt.contentList">
		 		<image style="width: 100%;" :src="modeyt.contentList[0].contentContent"  mode="widthFix"></image>
		 	</view>
		 </view>
		 <!-- 地图 -->
		 <view  class="map" @click="tomapfn">
		 			 <view class="title" style="padding:10rpx 30rpx;">
		 			 	活动地址
		 			 </view>
					 <view class="">
		 			 	<image style="" src="https://sy-hws-file-oss.oss-cn-beijing.aliyuncs.com/bojin.jpg" mode="heightFix"></image>
		 			 </view>
		 </view>
		 <!-- 模块四 -->
		 <view class="modeyfou"  >
		 	<view class="title" v-if="modeyfou.contentSmallTilte">
		 		{{modeyfou.contentSmallTilte}}
		 	</view>
			<view v-if="modeyfou.contentList.length!=0" class="f_image" style="overflow: auto;  display: -webkit-flex;  display: flex;">
				<view class="image"v-for="(item,index) in modeyfou.contentList" :key="index">
					<image @click="showImage(modeyfou.contentList)"  style="width: 400rpx;height: 250rpx;border-radius: 10rpx;":src="item.contentContent" mode=""></image>
				</view>
			</view>
		 </view>
		
		 <!-- 活动 -->
		 <view class="button_list" >
			 <view class="edit" @click="editinfo"  v-if="editshow">
			 	编辑活动
			 </view>
		 	<view class="sign" @click="tosign" v-if="signshow">
		 		签到领奖
		 	</view>
			<view class="vote" @click="tovote"  v-if="voteshow">
				投票赢奖
			</view>
			<view class="group" @click="togroup" v-if="groupshow">
				拼团优惠
			</view>
			<!-- <view class="group" @click="showpart"  v-if="partnerListshow">
				赞助单位
			</view> -->
			<view class="group" @click="toshopsponor"  v-if="partnerListshow">
				赞助单位
			</view>
			<view class="group" @click="tozhao"  v-if="partnerListshow">
				招商政策
			</view>
			<!-- <view class="group" @click="toatend" v-if="editshow">
				报名数据shopsponsor/shopsponsor
			</view> -->
		 </view>
		<!-- 活动浏览数据 -->
		<view class="activitynum">
			<view class="content">
				<uni-icons color="#fff" type="eye" size="20"></uni-icons>
                   <view class="num">
                   	<span>浏览量:</span>
					<span>{{looknum.viewsActivityNum}}</span>
                   </view>
			</view>
		</view>
		<!-- 我要报名  v-if="activityinfo.activityMoney"-->
		<view class="applyactivity" >
			<view class="a_button" @click="topay">
				会议报名
			</view>
			<view class="b_button" @click="backindex">
				返回首页
			</view>
		</view>
			<uni-popup ref="popup" type="center"   background-color="#fff" @change="changpop">
				<!-- 活动浏览数据 -->
				
				<scroll-view scroll-y="true" class="scroll-y">
					<view class="zanzhunum">
						<view class="content">
							<uni-icons color="#fff" type="eye" size="20"></uni-icons>
					           <view class="num">
					           	<span>浏览量:</span>
								<span>{{looknum.viewsZzNum}}</span>
					           </view>
						</view>
					</view>
					<view class="parterlist" style="border-radius: 10rpx;">
						<view class="parttop">
							<view class="title">
								年会赞助商
							</view>
							<view class="" style="">
								<view class="pt_list" style="">
									<view @click="toshop(item)" class="pt_item" v-for="(item,index) in activityinfo.partnerList" :key="index">
										<image v-if="item.storeImage" style="width: 120rpx; height: 120rpx;background-color: #f7f7f7;" :src="'https://image.dongzhice.com'+item.storeImage" mode="aspectFill"></image>
									     <image v-else style="width: 120rpx; height: 120rpx;background-color: #f7f7f7;" :src="defaultAvatar" mode="aspectFill"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="partcenter">
							<view class="title">
								年度赞助单位
							</view>
							<view class="pb_list">
								<view class="pb_item" v-for="(item,index) in supportshop" :key="index">
									{{item.shopname}}
								</view>
							</view>
						</view>
						<view class="partbuttom">
							<view class="title">
								年度十佳施工商
							</view>
							<view class="pb_list">
								<view class="pb_item" v-for="(item,index) in shoplist" :key="index">
									{{item.shopname}}
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			
			</uni-popup>
			<!-- 登录 -->
			<!-- <uni-popup ref="popLogin" type="dialog">
				<uni-popup-dialog type="input" :title="$L('提示')" :content="$L('请登录')" :duration="2000"
					@confirm="confirmLogins">
				</uni-popup-dialog>
			</uni-popup> -->
			
			<uni-popup ref="popEmpower" type="bottom">
				<view class="empower">
					<view class="empower_header">
						<view>东之策隐私政策提示</view>
					</view>
					<view>
						<text>请你在使用东之策小程序前点击</text>
						<text>《隐私政策》</text>
						<text>并仔细阅读。如你同意</text>
						<text>《隐私政策》</text>
						<text>的全部内容，请点击“同意并继续”开始我们的服务</text>
					</view>
					<view class="empower_button">
						<button class="login_btn"  @tap="getUserProfile">
							<text>{{ $L('同意并继续') }}</text>
						</button>
						<button class="login_btn2" @click="closeFn()">
							<text>{{ $L('取消') }}</text>
						</button>
						<!-- <view @click="closeFn()">拒绝</view> -->
						<!-- <view>
							<button class="login_btn"  @tap="getUserProfile">
								<text>{{ $L('登录') }}</text>
							</button>
						</view> -->
					</view>
					
				</view>
			</uni-popup>
		  <!-- 地图 -->
		  
		 <view class="" style="margin-bottom: 30%;">
		 	
		 </view>
	</view>
</template>

<script>
// import { loginGoPage } from '../../utils/common';
import uniPopup from '@/components/uni-popup/uni-popup.vue'
import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue'
import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
import {mapState,mapMutations} from 'vuex';
// import AMapLoader from "@amap/amap-jsapi-loader";
import amap from "@/static/amap-wx.130.js"
import { toFloat } from '../../utils/filter';
	export default {
		components:{
		uniPopup,
		uniPopupMessage,
		uniPopupDialog,	
		},
		data() {
			return {
				defaultAvatar: getApp().globalData.imgUrl + 'user/member-avatar.png', //默认头像
				dataInfo:{},
				location:{},
				amapPlugin: null,
				gaodekey: '1ff082e63b6d8f21ab6c949e51e54abf', //高德key,此处的key需要去高德平台申请获取，此key是假的！！！
				address: "", // 已经获取到的位置
				imgUrl: getApp().globalData.imgUrl,
				duration: 500,
				background: ['color1', 'color2', 'color3'],
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				activityinfo:{},
				modeyf:{},
				modeys:{},
				modeyt:{},
				modeyfou:{},
				id:null,
				editshow:false,//编辑按钮
				stateshow:false,
				signshow:false,//签到按钮
				voteshow:false,//投票按钮
				groupshow:false,//拼团商品
				partnerListshow:false,//赞助商
				shoplist:[
					{shopname:'江苏新意建设有限公司'},
					{shopname:'安徽万鼎建设工程有限公司'},
					{shopname:'安徽沁钰建设工程有限公司'},
					{shopname:'安徽沁钰建设工程有限公司'},
					{shopname:'安徽丹玉交通设施有限公司'},
					{shopname:'安徽美地建设工程有限公司'},
					{shopname:'安徽烁阳建设工程有限公司'},
					{shopname:'安徽晶垚建材科技有限公司'},
					{shopname:'安徽锺鼎环境工程有限公司'},
					{shopname:'安徽驰耐邦体育产业有限公司'},
					{shopname:'安徽创大环氧地坪装饰有限公司'},
				],
				supportshop:[
					{shopname:'上海集丰复合材料有限公司'},
					{shopname:'常州市丽烨制桶有限公司'},
					{shopname:'北京星途新材料有限公司'},
					{shopname:'马鞍山鑫荣新材料科技有限公司'},
					{shopname:'苏州天常建材有限公司'},
					{shopname:'安徽湿云科技集团有限公司'},
					{shopname:'施贝化学（中国）有限公司'},
					{shopname:'安徽灿华新型建材有限公司'},
					{shopname:'安徽太木新材料有限公司'},
					{shopname:'浙江世明光学科技有限公司'},
					{shopname:'三门鸿先橡塑有限公司'},
					{shopname:'安徽哈喽建材装饰工程有限公司'},
					{shopname:'河北宇森网类制品有限公司'},
					{shopname:'上海台丰实业发展有限公司'},
					{shopname:'安徽喜宝高分子材料有限公司'},
					{shopname:'上海韩驰化工有限公司'},
					{shopname:'杭州纳财机械设备有限公司'},
					{shopname:'上海亚遥工程机械有限公司'},
					{shopname:'四川鹏程新材料科技有限公司'},
					{shopname:'常州新世邦佳明化工有限公司'},
					{shopname:'合肥亨斯迈化工科技集团有限公司'},
					{shopname:'上海震立化工有限公司'},
					{shopname:'上海博尔泰工业产品设计有限公司'},
					{shopname:'安徽飞艳颜料有限公司'},
					{shopname:'上海雅牧机械科技有限公司'},
					{shopname:'安徽名图环保材料科技有限公司'},
					{shopname:'塑驰新型材料（江苏）有限公司'},
					{shopname:'安徽星美特建材科技有限公司'},
					{shopname:'上海正欧实业有限公司'},
					{shopname:'上海维度化工科技有限公司'},
					{shopname:'上海率土涂料有限公司'},
					{shopname:'安徽惠井科技集团有限公司'},
					{shopname:'南京淳鼎高分子材料有限公司'},
					{shopname:'南通鸿博涂装工程有限公司'},
					{shopname:'宝丰县远达地坪工程有限公司'},
					{shopname:'苏州梅果望地坪材料有限公司'},
					{shopname:'衡水澳德彩建筑装饰材料有限公司'},
					{shopname:'树勋（上海）环保建材有限公司'},
					{shopname:'苏州工业园区鸿坤环境科技有限公司'},
				],//支持单位
				wtCode: '',
				adress:'',
				starttime:'',
				endtime:'',
				timelong:'',
				memberId:'',
				storeId:'',
				shopId:'',
				show:false,
				looknum:{},//浏览数据
			};
		},
		async onLoad(options) {
			// if (!this.hasLogin) {
			// 	setTimeout(()=>{
			// 		this.$refs.popLogin.open()
			// 	},500)
			// 	return
			// }
			
			// console.log(options,this.$Route.query);
			this.id= this.$Route.query.id
			 this.addnum()
			 this.getlooknum()
			// // #ifdef MP-WEIXIN
			// 					 if(!this.hasLogin){
			// 					console.log(this.hasLogin);
			// 					 }
			// // #endif
			this.getactivityinfo({id:this.id})
             // // #ifdef MP-WEIXIN
             // 					 if(!this.hasLogin){
             					
             // 						this.getLogin()
             // 					 }
             // // #endif
			 
			 this.memberId=this.$Route.query.memberId
			 this.storeId=this.$Route.query.storeId
			this.shopId=this.$Route.query.shopId
					if(this.storeId){
			 			uni.setStorageSync('storeId', this.storeId);
			 		}
					if(this.shopId){
						uni.setStorageSync('shopId', this.shopId);
					}
			 // 保存推荐人id
			 if(this.memberId){
			 	uni.setStorageSync('referrerId', this.memberId);
			 }
			 	this.client = this.$wxLoginClient()
				
				this.amapPlugin = new amap.AMapWX({
					key: this.gaodekey
				});
				// this.getLocation()
				
		},
		onShow() {
			// #ifdef MP-WEIXIN
								 if(!this.hasLogin){
									this.getLogin()
									
								 }
			// #endif
				this.starttime=new Date().getTime()
		},
		onShareAppMessage:function(){
			console.log(this.userCenterData.memberId,'11');
			let pathinfo=''
			let limag=this.activityinfo.shareImage
			if(this.userCenterData.vendorId){
				 pathinfo=`/extra/activityinfo/activityinfo?id=${this.id}&memberId=${this.userCenterData.memberId}&storeId=${this.userCenterData.vendorId}&shopId=${this.userCenterData.storeId}`
			}else{
				 pathinfo=`/extra/activityinfo/activityinfo?id=${this.id}&memberId=${this.userCenterData.memberId}`
			}
			// let pathinfo='/extra/activityList/activityList'
			return{
				title: this.activityinfo.activityTitle,
				path:pathinfo,
				imageUrl: limag,
			}
			
		},
		onShareTimeline: function() {
			let limag=this.activityinfo.shareImage
			let pathinfo=''
			if(this.userCenterData.vendorId){
				  pathinfo=`/extra/activityinfo/activityinfo?id=${this.id}&memberId=${this.userCenterData.memberId}&storeId=${this.userCenterData.vendorId}&shopId=${this.userCenterData.storeId}`
			}else{
				  pathinfo=`/extra/activityinfo/activityinfo?id=${this.id}&memberId=${this.userCenterData.memberId}`
			}
			return {
				title: this.activityinfo.activityTitle,
				path:pathinfo,
				imageUrl: limag,
			}
		},
		computed: {
					...mapState(['hasLogin', 'userInfo', 'userCenterData']),
					},
					
	onPullDownRefresh() {
						// 刷新位置
						 this.getactivityinfo({id:this.id})
						// #ifdef MP-WEIXIN
											 if(!this.hasLogin){
											
												this.getLogin()
											 }
						// #endif
							// var that=this
							// uni.startPullDownRefresh({
							// 	success() {
									
							// 	},
							// 	fail(){
							// 		that.$refs.uToast.show({
							// 			type:'error',
							// 			title:'刷新失败'
							// 		})
							// 	}
							// })
							setTimeout(function(){
								uni.stopPullDownRefresh()
							},1000)
					},
				onHide() {
						this.endtime=new Date().getTime()
						this.timelong=this.endtime-this.starttime
						if(this.hasLogin){
							 this.addcustomer()
						}
						
						
						},	
		methods:{
			// 返回
			backindex(){
				// console.log('2121');
				uni.switchTab({
					url:'/pages/index/index'
				})
			},
			toshopsponor(){
				uni.navigateTo({
					url:"/extra/shopsponsor/shopsponsor?id="+this.id
				})
			},
			// 增加浏览次数
			addnum(){
				this.$request({
					url:'v3/activity/front/activity/view/add/count',
					method:'GET',
					data:{
						activityId:this.id,
						viewsType:'1'
					}
				})
			},
			// 获取浏览量
			getlooknum(){
			  this.$request({
				  url:'v3/activity/front/activity/view/count',
				  method:'GET',
				  data:{activityId:this.id}
			  }).then(res=>{
				  this.looknum=res.data
			  })	
			},
			timechange(time){
			 	 //时间戳为10位需*1000，时间戳为13位的话不需乘1000
			 	  var date = new Date(time);
			 	  var Y = date.getFullYear() + '-';
			 	  var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth()+1) : date.getMonth() + 1) + '-';
			 	  var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
			 	  var h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
			 	  var m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes())+ ':';
			 	  var s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
			 	  return  Y + M + D + h + m + s;
			 },
			// 添加
			addcustomer(){
				if(this.activityinfo.activityId){
					let pnone=uni.getDeviceInfo()
						
						let param={}
						
						param.data=
						{
							address:uni.getStorageSync('address'),//地址
							avatar:this.userCenterData.memberAvatar,//头像
							birthday:'2023-11-09',//生日
							browGoods:this.activityinfo.activityTitle,//活动名称
							browGoodsId:this.activityinfo.activityId,//商品id
							browTime:(this.timelong/1000).toFixed(1),
							company:'',//公司
							createBy:this.userCenterData.memberName,
							createTime:this.timechange(new Date()),
							cusCustomerIntention:'3',//客户意向方（0-高意向，1-中意向，2-低意向）
							cusDealOrNot:'1',//(0-已成交，1-未成交)
							// cusFollowStage:'0',//跟进阶段(0-初步沟通，1-确定意向，2-等待付款)
							customerDescription:'',//	客户描述
							customerName:this.userCenterData.memberName,//客户姓名
							email:this.userCenterData.memberEmail,//邮箱
							jobTitle:'',//职务名称
							phoneAddress:uni.getStorageSync('address'),//手机号地址
							phoneNum:this.userCenterData.memberMobile,//手机号
							referrerId:this.memberId,
							referrerUsername:'',
							scoreUsername:'活动',//渠道
							sex:this.storeId,//性别
							source:'0',//来源
							wechatId:'',//微信号
							wechatName:'',//微信昵称
							temporaryId:pnone.deviceId,
							// customerTaskId:this.$Route.query.taskId,
							// customerIndexId:this.$Route.query.indexId,
						}
						
						param.url='v3/customer/front/appCustomer'
						param.method="POST"
						param.header={
						  'Content-Type': 'application/json'
						}
						// param.data=JSON.stringify(param.data)
						console.log(param);
						this.$request(param)
				}
			
				
			},
			getLocation() {
			    const _this = this;
			    this.amapPlugin = new amap.AMapWX({
			        key: this.gaodekey
			    });
			    uni.showLoading({
			        title: '获取信息中'
			    });
			    // 成功获取位置
			    _this.amapPlugin.getRegeo({
			        success: (data) => {
			            console.log(data, '当前定位');
			            _this.dataInfo=data[0]
			            _this.address =`${data[0].regeocodeData.addressComponent.city}${data[0].regeocodeData.addressComponent.district}`;
			            
			            // _this.address 可根据自己的实际情况修改
			            _this.address = `${data[0].regeocodeData.formatted_address}`;
						// 储存
						// uni.setStorageSync('province',data[0].regeocodeData.addressComponent.province)
						// uni.setStorageSync('city',data[0].regeocodeData.addressComponent.city)
						// uni.setStorageSync('district',data[0].regeocodeData.addressComponent.district)
						// 传出
			            _this.$emit("lodAddress",_this.address)
			            uni.hideLoading();
						// this.openmap()
			        },
			        // 获取位置失败
			        fail: (err) => {
						console.log(err,'333');
			            uni.showToast({
			                title: "获取位置失败，请重启小程序",
			                icon: "error"
			            })
						 uni.hideLoading();
			        }
			    });
			},
			//得到用户位置经纬度 以及授权
			// getLocation(){
			// 	var that = this
			// 	uni.getLocation({
			// 		success(res) {
			// 			that.location.lat = res.latitude
			// 			that.location.log = res.longitude
			// 			console.log('获取位置成功',res);
			// 			that.openmap()
			// 		}
			// 		,
			// 		fail(res){
			// 			console.log('获取位置失败',res);
			// 		}
			// 	});
			// 	console.log('huoqu');
			// },
			//打开地图
			tomapfn(){
			this.openmap()	
			},
			openmap(){
				console.log('打开地图2',this.dataInfo);
				 // this.dataInfo.latitude=Number(117.345304)
				 // this.dataInfo.longitude=Number(31.783233)
				uni.openLocation({
					// latitude:31.745740,
					// longitude:117.284636,
					latitude:Number(this.activityinfo.latitude),
					longitude:Number(this.activityinfo.longitude),
					name: this.activityinfo.address,
					address: this.activityinfo.address
				})
			},
			
			
			confirmLogins() {
						 
							// let url = this.$Route.path
							// const query = this.$Route.query
							this.$refs.popLogin.close()
							// uni.setStorageSync('fromurl', {
							// 	url,
							// 	query
							// })
							this.$Router.push('/pages/public/login')
						},
			//判断小程序分享进入详情是否登录
			// getLogin(){
			// 	console.log('是否授权登录11');
			// 	let _this=this
			// 	setTimeout(()=>{
			// 		_this.$refs.popEmpower.open()
			// 	},1000)
			// 	wx.exitMiniProgram({
			// 		success: function() {
			// 			console.log('退出小程序成功');
			// 		},
			// 		fail: function(err) {
			// 			console.log('退出小程序失败', err);
			// 		}
			// 	})
			  
			// },
			...mapMutations(['login', 'setUserCenterData', 'saveChatBaseInfo']),
				
			closeFn(){
				let _this=this
				setTimeout(()=>{
					_this.$refs.popEmpower.close()
				},1000)
				              
			},
			//判断小程序分享进入详情是否登录
			getLogin(){
				console.log('是否授权登录1111');
				let _this=this
				setTimeout(()=>{
					_this.$refs.popEmpower.open()
				},1000)
				// wx.exitMiniProgram({
				// 	success: function() {
				// 		console.log('退出小程序成功');
				// 	},
				// 	fail: function(err) {
				// 		console.log('退出小程序失败', err);
				// 	}
				// }) .
			  
			},
			getUserProfile(e){
					let that = this
				uni.getUserProfile({
					desc: that.$L('用于完善个人信息'), // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
					success: (res) => {
						if (res.errMsg == 'getUserProfile:ok') {
							let userinfo = res.userInfo
							this.getWxXcxCoce(userinfo)
						}
					},
				})
			},
			//微信小程序根据用户信息获取code
			getWxXcxCoce(userinfo) {
				uni.showLoading({
					title: this.$L('正在请求...'),
					mask: true
				})
				uni.login({
					success: (code) => {
						this.toLogin(code.code, JSON.stringify(userinfo))
					}
				})
			},
			//登录 code为用户的code【微信小程序或者微信h5】  userInfo为获取到的微信用户信息
			toLogin(code, userInfo = '') {
				this.wtCode = code
			
				let {
					client
				} = this
				let _this = this
				let param = {}
				param.url = 'v3/member/front/login/wechat/login'
				param.data = {}
				param.data.source = client
				param.data.code = code
				// #ifdef APP-PLUS
				param.data.clientId = uni.getStorageSync('clientId');
				// #endif
			
				//如果有缓存的购物车数据，登录需要把数据同步，并清除本地缓存
				if (this.$getUnLoginCartParam()) {
				  param.data.cartInfo = this.$getUnLoginCartParam()
				}
				if (userInfo) {
					param.data.userInfo = userInfo
				}
				param.method = 'POST'
				this.$request(param)
					.then((res) => {
						console.log(res);
						_this.closeFn()
						if (res.state == 200) {
							uni.hideLoading()
							uni.setStorage({
								key: 'sld_login_time',
								data: new Date().getTime(),
							});
							
							if (res.data.redirect == undefined) {
								console.log('res.data.redirect');
								uni.removeStorage({
									key: 'cart_list'
								}) //清除购物车数据
								uni.setStorage({
									key: 'userInfo',
									data: res.data,
									success() {
										//登录时间
										res.data.loginTime = Date.parse(new Date())
										_this.login(res.data)
										//登录成功 获取个人中心的数据
										_this.$request({
												url: 'v3/member/front/member/memberInfo'
											})
											.then((result) => {
												console.log('result',result);
												_this.setUserCenterData(result.data)
												_this.initData()
												_this.getSetting()
												_this.$forceUpdate()
											})
									}
								})
							} else if (res.data.redirect != undefined) {
								//用户未注册，需要绑定手机号进行注册
								this.showState = true
								
								// #ifndef MP-WEIXIN
								this.$Router.push({
									path: '/pages/public/bindMobile',
									query: {
										code: res.data.bindKey
									}
								})
								// #endif
							
								// #ifdef MP-WEIXIN
								this.$refs.wxBindPhone.openKey(res.data.bindKey)
								// #endif
							}
						
					
						} else {
							uni.hideLoading()
							//错误提示
							_this.$api.msg(res.msg)
						}
					})
			},
			//获取个人中心数据
			initData() {
				let that = this
				if (this.userInfo.access_token) {
					this.$request({
							url: 'v3/member/front/member/getInfo'
						})
						.then((res) => {
							uni.stopPullDownRefresh()
							if (res.state == 200) {
								that
									.$request({
										url: 'v3/helpdesk/front/chat/unReadMsgNum'
									})
									.then((response) => {
										if (response.state == 200) {
											res.data.msgNum = response.data
											that.setUserCenterData(res.data)
										} else {
											that.setUserCenterData(res.data)
										}
									})
							} else {
								this.$api.msg(res.msg)
							}
						})
						.catch((e) => {})
			
					//获取订单订单未完成数量
					this.$request({
						url: 'v3/integral/front/integral/order/orderCount'
					}).then((res) => {
						if (res.state == 200) {
							this.pointOrderNums = res.data
						}
					})
			
					this.$request({
						url: 'v3/video/front/video/author/personPage'
					}).then((res) => {
						if (res.state == 200) {
							this.authorInfo = res.data
						}
					})
				} else {
					uni.stopPullDownRefresh()
				}
			},
			// 获取设置信息
			getSetting() {
				let param = {}
				param.url = 'v3/video/front/video/setting/getSettingList'
				param.method = 'GET'
				param.data = {}
				param.data.str = 'video_switch,live_switch'
				this.$request(param).then((res) => {
					if (res.state == 200) {
						let result = res.data
						result &&
							result.map((settingItem) => {
								if (settingItem.name == 'video_switch') {
									//绑定商品数
									// this.setting.video_switch = settingItem.value
								} else {
									// this.setting.live_switch = settingItem.value
								}
							})
					}
				})
			},
			showImage(val){
			let arry=[]
			val.forEach(item=>{
				if(item.contentContent){
					arry.push(item.contentContent)
				}
			})
				uni.previewImage({
					urls:arry,//图片数组
					current:arry[0]
				})
			},
			// 获取活动详情
			getactivityinfo(val){
				uni.showLoading({
					title: this.$L('正在请求...'),
					mask: true
				})
				this.$request({
					url:'v3/activity/front/activity/detail/'+val.id,
					method:'GET'
				}).then(res=>{
						uni.hideLoading()
					// if(res.state==200){
					// 	uni.hideLoading()
					// }
					this.activityinfo=res.data

					// 判断是否有编辑权限
					if(this.activityinfo.createId==this.userCenterData.memberId){
						this.editshow=true
					}
					
					if(this.activityinfo.activityState==2){
						if(this.activityinfo.activityType=='true'){
							this.signshow=true
						}
						if(this.activityinfo.activityExtra2!=0){
							this.voteshow=true
						}
						if(this.activityinfo.activityExtra3){
							this.groupshow=true
						}
						if(this.activityinfo.partnerList.length!=0){
							this.partnerListshow=true
						}
						
						
					}
					
					this.activityinfo.titleVOList.forEach(item=>{
						if(item.titleSequence==1){
							this.modeyf=item
						}else if(item.titleSequence==2){
							this.modeys=item
						}else if(item.titleSequence==3){
							this.modeyt=item
						}else if(item.titleSequence==4){
							this.modeyfou=item
						}
					})
				})
			},
			// 跳转招商政策
			tozhao(){
			uni.navigateTo({
				url:'/extra/attractInvestment/attractInvestment?id='+this.activityinfo.activityId
			})
			},
			// 跳转商户
			toshop(val){
				this.$Router.push({
					path:'/standard/store/shopHomePage',
					query:{vid:val.storeId}
				})
			},
			topay(){
				
				if(this.hasLogin){
					uni.navigateTo({
						url:'/extra/activitypay/activitypay?id='+this.activityinfo.activityId
					})
				}else{
			      this.$refs.popEmpower.open()
				}
				
			},
			// 编辑
			editinfo(){
				uni.navigateTo({
					url:'/extra/activeAdd/activeAdd?id='+this.activityinfo.activityId
				})
			},
			tosign(){
				uni.navigateTo({
					url:'/standard/signIn/signIn?id='+this.id
				})
			},
			tovote(){
				uni.navigateTo({
					url:'/standard/voteinfo/voteinfo?id='+this.id
				})
			},
			togroup(){
				this.$Router.push({
					path:'/standard/product/detail',
					query:{
						productId:this.activityinfo.activityExtra3,
						goodsId:this.activityinfo.goodsId
					}
				})
			},
			// 报名数据
			toatend(){
				this.$Router.push({
					path:'/extra/atendactivity/atendactivity',
					query:{
						activityId:this.activityinfo.activityId
					}
				}) 
			},
			// 查看找赞助商
			showpart(){
				 
				this.$refs.popup.open()
				this.$request({
					url:'v3/activity/front/activity/view/add/count',
					method:'GET',
					data:{
						activityId:this.id,
						viewsType:'3'
					}
				})
				
			},
			
			changpop(e){
				this.show=e.show
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
			width: 750rpx;
			margin: 0 auto;
			background: #F5F5F5;
			overflow: hidden;
		}
.warp{
	#maps {
	  width: 100%;
	  height: calc(100vh - 400px);
	}
	background-color: #fff;
	.banner{
			
			
		.uni-margin-wrap {
				width: 690rpx;
				width: 100%;
			}
			.swiper {
				height: 300rpx;
			}
			.swiper-item {
				display: block;
				height: 300rpx;
				line-height: 300rpx;
				text-align: center;
			}
			.swiper-list {
				margin-top: 40rpx;
				margin-bottom: 0;
			}
	}
	.title{
			   padding: 10rpx 0;
			   margin-top: 10rpx;
			   font-size: 38rpx;
			   font-weight: 550;
		   }
	.modey_f{
	       padding: 20rpx 30rpx;
		  
	}
	.modey_s{
		 padding: 20rpx 30rpx;
		 .image_list{
			 // display: flex;
			 .image{
				 margin-right: 10rpx;
			 }
		 }
	}
	.modey_t{
		 padding: 20rpx 0;
		 .image_lang{
			 text-align: center;
		 }
		 
	}
	.modeyfou{
		 padding: 20rpx 30rpx;
		.f_image{
			.image{
				margin-right: 10rpx;
			}
		}
	}
	.applyactivity{
		display: flex;
		align-items: center;
		position: fixed;
		bottom: 10rpx;
		left: 25%;
		.b_button{
			font-size: 24rpx;
			margin-left: 60rpx;
			text-align: center;
			line-height: 60rpx;
			color: #fff;
		
			padding: 0 20rpx;
			height: 60rpx;
			// background-color: #ffb866;
			border-radius: 40rpx;
			border: 2rpx solid #fc701e;
		}
		.a_button{
			text-align: center;
			line-height: 80rpx;
			color: #fff;
			font-size: 32rpx;
			width: 320rpx;
			height: 80rpx;
			background-color: #ff841f;
			border-radius: 40rpx;
		}
	}
	// 赞助商弹框
	.scroll-y{
		height: 1000rpx;
		position: relative;
		.zanzhunum{
			position: absolute;
			top: 10rpx;
			right: 10rpx;
			.content{
				border-radius: 10rpx;
				padding: 10rpx;
				display: flex;
				align-items: center;
				background-color:rgba(0, 0, 0, 0.2);
				.num{
					margin-left: 10rpx;
					color: #fff;
				}
			}
		}
		.parterlist{
			background-color: #fff;
			padding: 20rpx;
			width: 710rpx;
			.parttop{
				padding-bottom: 20rpx;
				border-bottom: 2rpx solid #cecece;
				.title{
					font-size: 32rpx;
					margin-bottom: 30rpx;
					border-bottom: 2rpx solid #f5f5f5;
				}
				.pt_list{
					display: flex;
					// justify-content: space-between;
					flex-wrap: wrap;
					align-items: center;
					.pt_item{
						width: 130rpx;
						margin-bottom: 6rpx;
						margin-left: 20rpx;
						height: 130rpx;
						line-height: 180rpx;
						background-color: #fff;
						margin-right: 10rpx;
						border-right: 2rpx solid #cecece;
						padding-right: 20rpx;
					}
				}
			}
			.partcenter,.partbuttom{
				margin-top: 20rpx;
				.title{
					font-size: 32rpx;
					margin-bottom: 30rpx;
					border-bottom: 2rpx solid #f5f5f5;
				}
				.pb_list{
					display: flex;
					justify-content: space-between;
					flex-wrap: wrap;
					.pb_item{
						font-size: 24rpx;
						padding: 10rpx 10rpx;
						background-color: #f7f7f7;
						margin-bottom: 10rpx;
						border-radius: 10rpx;
					}
				}
			}
		}
	}
	// 浏览数据
	.activitynum{
		position: fixed;
		top: 30%;
		right: 10rpx;
		.content{
			border-radius: 10rpx;
			padding: 10rpx;
			display: flex;
			align-items: center;
			background-color:rgba(0, 0, 0, 0.2);
			.num{
				margin-left: 10rpx;
				color: #fff;
			}
		}
	}
	// 活动
	.button_list{
		position: fixed;
		right: 0;
		top: 46%;
		height: 380rpx;
		display: flex;
		flex-direction: column;
		
		.edit,.sign,.vote,.group{
			width: 110rpx;
			height: 110rpx;
			padding: 25rpx;
			border-radius: 50%;
			background-color: #ff841f;
			color: #fff;
			text-align: center;
			font-size: 24rpx;
			margin-bottom: 20rpx;
		}
	}
}
.empower{
		background-color: #ededed;
		padding: 20rpx;
		border-radius: 15rpx 15rpx 0 0;
	}
	.empower_header{
		padding:20rpx;
		width:100%;
		text-align: center;
		font-weight: 700;
		font-size: 30rpx;
	}
	.empower_button{
		margin-top: 10rpx;
		padding:20rpx 50rpx;
		
		// display: flex;
		// align-items: center;
		// justify-content: center;
		
	}
	.login_btn {
		background: #fc701e;
		color: #fff;
		border-radius: 50rpx;
		font-size: 24rpx;
		
	
		&::after {
			border: none;
		}
	
		text-align: center;
	}
	.login_btn2{
		color: #dadada;
		border-radius: 50rpx;
		font-size: 24rpx;
		margin-top: 15rpx;
		
			
		&::after {
			border: none;
		}
			
		text-align: center;
	}
</style>
